<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>margin注意事项二</title>
    <style>
      .box {
        width: 400px;
        height: 400px;
      }
      .box1 {
        background-color: blue;
      }
      .box2 {
        background-color: green;
        margin-top: 100px;
        margin-bottom: 100px;
      }
      .box3 {
        background-color: orange;
      }
      .s1 {
        background-color: red;
      }
      .s2 {
        margin-right: 20px;
        background-color: orange;
        margin-left: 40px;
      }
      .s3 {
        background-color: yellowgreen;
      }
    </style>
</head>
<body>
<!--  结论：margin上外边距时是将自己和下面的元素向下移动 下边距时自己不动将下面的元素向下移动 -->
    <div class="box box1"></div>
    <div class="box box2"></div>
    <div class="box box3"></div>
    <hr>
<!-- 结论:margin上右边距是将自己右边的元素向右移动，自己不动  左边距是自己将自己和右边的元素一起向右移动 -->
<span class="s1">span1</span><span class="s2">span2</span><span class="s3">span3</span>
</body>
</html>